﻿using Ongoal.Quotation.Common;
using Ongoal.Quotation.Service.Common;
using Ongoal.Quotation.Service.Model;
using Ongoal.Quotation.Service.Param;
using Ongoal.Quotation.Service.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ongoal.Quotation.Service.Interface
{
    /// <summary>
    /// 用户接口
    /// </summary>
    
    public interface IUserService : IServiceBase
    {
        /// <summary>
        /// 新增用户
        /// </summary>
        /// <param name="user"></param>
        /// <param name="errorMsg"></param>
        /// <returns></returns>
        bool AddUser(ViewUser user, ref string errorMsg);

        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="userList"></param>
        /// <param name="errorMsg"></param>
        /// <returns></returns>
        bool Delete(List<int> userList, ref string errorMsg);

        /// <summary>
        /// 编辑用户
        /// </summary>
        /// <param name="user"></param>
        /// <param name="errorMsg"></param>
        /// <returns></returns>
        bool EditUser(ViewUser user, ref string errorMsg);

        /// <summary>
        /// 分页查询用户
        /// </summary>
        /// <param name="PaginationEntity"></param>
        /// <param name="usertype"></param>
        /// <param name="orgid"></param>
        /// <param name="keyword"></param>
        /// <returns></returns>
        object Getuserbypage(PaginationData PaginationEntity, int usertype, int orgid, string keyword);


        /// <summary>
        /// 分页查询用户
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        dynamic GetUserOrg(int userID);

        /// <summary>
        /// 修改用户密码
        /// </summary>
        /// <param name="oldPwd"></param>
        /// <param name="newPwd"></param>
        /// <returns></returns>
        dynamic UpdatePwd(string oldPwd, string newPwd);

        /// <summary>
        /// 修改用户头像
        /// </summary>
        /// <param name="avatarid"></param>
        /// <returns></returns>
        dynamic UpdateAvatar(string avatarid);

        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <returns></returns>
        object GetUserInfo();

        #region 根据多个机构Id集合获取多个机构下人员
        /// <summary>
        /// 根据多个机构Id集合获取多个机构下人员
        /// </summary>
        /// <param name="Param">参数（）</param>
        /// <returns></returns>
        Task<dynamic> GetOrgUserList(PublicParam Param);
        #endregion

        #region 根据多个人员Id集合获取多个机构
        /// <summary>
        /// 根据多个人员Id集合获取多个机构
        /// </summary>
        /// <param name="Param">参数（）</param>
        /// <returns></returns>
        Task<dynamic> GetUserOrgList(PublicParam Param);
        #endregion

        #region 获取所有用户信息
        /// <summary>
        /// 获取所有用户信息
        /// </summary>
        /// <returns></returns>
        Task<dynamic> GetUserList();
        #endregion

        #region 获取组织与人员
        /// <summary>
        /// 获取组织与人员
        /// </summary>
        /// <param name="Param">参数（）</param>
        /// <returns></returns>
        Task<dynamic> GetOrgAndUser(PublicParam Param);
        #endregion
    }
}
